package com.eurabia.eggchat.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.eurabia.eggchat.pojo.SysEggchatReply;
import com.eurabia.eggchat.pojo.form.SysEggchatReplyForm;
import com.eurabia.eggchat.pojo.query.SysEggchatReplyQuery;
import com.eurabia.eggchat.dao.SysEggchatReplyDao;
import com.eurabia.eggchat.service.SysEggchatReplyService;

import javax.annotation.Resource;


/**
 * SysEggchatReplyService 
 */
@Service
public class SysEggchatReplyServiceImpl implements SysEggchatReplyService {
    @Resource
    private SysEggchatReplyDao sysEggchatReplyDao;
	
	/**
     * 查询 SysEggchatReply
     */
    @Override
    public List<SysEggchatReply> find(final SysEggchatReplyQuery query) {
        return sysEggchatReplyDao.find(query);
    }
    
    /**
     * 分页查询 SysEggchatReply
     */
    @Override
    public Page<SysEggchatReply> findByPage(final SysEggchatReplyQuery query) {
        PageHelper.startPage(query.getPage().intValue(), query.getLimit().intValue());
        return (Page<SysEggchatReply>) sysEggchatReplyDao.find(query);
    }

    /**
     * 通过id得到一个 SysEggchatReply
     */
    @Override
    public SysEggchatReply get(final String id) {
        return sysEggchatReplyDao.get(id);
    }
    
    /**
     * 新增 SysEggchatReply
     */
    @Override
    public void add(final SysEggchatReplyForm form) {
        sysEggchatReplyDao.add(form);
    }

    /**
     * 修改 SysEggchatReply
     */
    @Override
    public int update(final SysEggchatReplyForm form) {
        return sysEggchatReplyDao.update(form);
    }
    
    /**
     * 删除一个 SysEggchatReply
     */
    @Override
    public int delete(final String id) {
        return sysEggchatReplyDao.delete(id);
    }
	
	/**
     * 修改是否可用
     */
    @Override
    public int changeEnabled(final String id, final Integer enabled) {
        return sysEggchatReplyDao.changeEnabled(id, enabled);
    }
}